package org.southyin.ioc;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.Arrays;

public class Main {
    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
        String[] names = context.getBeanDefinitionNames();
        System.out.println(Arrays.toString(names));
        Person person = context.getBean("person", Person.class);
        System.out.println(person);
        SpringConfig springConfig = context.getBean("springConfig", SpringConfig.class);
        System.out.println(springConfig);
        Student getStudent = context.getBean("getStudent", Student.class);
        System.out.println(getStudent);
    }
}
